//
//	ExtensionList.m
//
//	Create by jiang hao on 9/8/2016
//	Copyright © 2016. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "ExtensionList.h"

NSString *const kExtensionListAreaid = @"areaid";
NSString *const kExtensionListAreaidCxzs = @"areaid_cxzs";
NSString *const kExtensionListIdField = @"id";
NSString *const kExtensionListImg = @"img";
NSString *const kExtensionListIshavead = @"ishavead";
NSString *const kExtensionListJumptype = @"jumptype";
NSString *const kExtensionListJumpurl = @"jumpurl";
NSString *const kExtensionListPvid = @"pvid";
NSString *const kExtensionListRdposturl = @"rdposturl";
NSString *const kExtensionListSeriesid = @"seriesid";
NSString *const kExtensionListSeriesname = @"seriesname";
NSString *const kExtensionListThirdadurl = @"thirdadurl";
NSString *const kExtensionListThurl = @"thurl";
NSString *const kExtensionListUrl = @"url";

@interface ExtensionList ()
@end
@implementation ExtensionList




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kExtensionListAreaid] isKindOfClass:[NSNull class]]){
		self.areaid = [dictionary[kExtensionListAreaid] integerValue];
	}

	if(![dictionary[kExtensionListAreaidCxzs] isKindOfClass:[NSNull class]]){
		self.areaidCxzs = [dictionary[kExtensionListAreaidCxzs] integerValue];
	}

	if(![dictionary[kExtensionListIdField] isKindOfClass:[NSNull class]]){
		self.idField = [dictionary[kExtensionListIdField] integerValue];
	}

	if(![dictionary[kExtensionListImg] isKindOfClass:[NSNull class]]){
		self.img = dictionary[kExtensionListImg];
	}	
	if(![dictionary[kExtensionListIshavead] isKindOfClass:[NSNull class]]){
		self.ishavead = [dictionary[kExtensionListIshavead] integerValue];
	}

	if(![dictionary[kExtensionListJumptype] isKindOfClass:[NSNull class]]){
		self.jumptype = [dictionary[kExtensionListJumptype] integerValue];
	}

	if(![dictionary[kExtensionListJumpurl] isKindOfClass:[NSNull class]]){
		self.jumpurl = dictionary[kExtensionListJumpurl];
	}	
	if(![dictionary[kExtensionListPvid] isKindOfClass:[NSNull class]]){
		self.pvid = dictionary[kExtensionListPvid];
	}	
	if(![dictionary[kExtensionListRdposturl] isKindOfClass:[NSNull class]]){
		self.rdposturl = dictionary[kExtensionListRdposturl];
	}	
	if(![dictionary[kExtensionListSeriesid] isKindOfClass:[NSNull class]]){
		self.seriesid = [dictionary[kExtensionListSeriesid] integerValue];
	}

	if(![dictionary[kExtensionListSeriesname] isKindOfClass:[NSNull class]]){
		self.seriesname = dictionary[kExtensionListSeriesname];
	}	
	if(![dictionary[kExtensionListThirdadurl] isKindOfClass:[NSNull class]]){
		self.thirdadurl = dictionary[kExtensionListThirdadurl];
	}	
	if(![dictionary[kExtensionListThurl] isKindOfClass:[NSNull class]]){
		self.thurl = dictionary[kExtensionListThurl];
	}	
	if(![dictionary[kExtensionListUrl] isKindOfClass:[NSNull class]]){
		self.url = dictionary[kExtensionListUrl];
	}	
	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	dictionary[kExtensionListAreaid] = @(self.areaid);
	dictionary[kExtensionListAreaidCxzs] = @(self.areaidCxzs);
	dictionary[kExtensionListIdField] = @(self.idField);
	if(self.img != nil){
		dictionary[kExtensionListImg] = self.img;
	}
	dictionary[kExtensionListIshavead] = @(self.ishavead);
	dictionary[kExtensionListJumptype] = @(self.jumptype);
	if(self.jumpurl != nil){
		dictionary[kExtensionListJumpurl] = self.jumpurl;
	}
	if(self.pvid != nil){
		dictionary[kExtensionListPvid] = self.pvid;
	}
	if(self.rdposturl != nil){
		dictionary[kExtensionListRdposturl] = self.rdposturl;
	}
	dictionary[kExtensionListSeriesid] = @(self.seriesid);
	if(self.seriesname != nil){
		dictionary[kExtensionListSeriesname] = self.seriesname;
	}
	if(self.thirdadurl != nil){
		dictionary[kExtensionListThirdadurl] = self.thirdadurl;
	}
	if(self.thurl != nil){
		dictionary[kExtensionListThurl] = self.thurl;
	}
	if(self.url != nil){
		dictionary[kExtensionListUrl] = self.url;
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:@(self.areaid) forKey:kExtensionListAreaid];	[aCoder encodeObject:@(self.areaidCxzs) forKey:kExtensionListAreaidCxzs];	[aCoder encodeObject:@(self.idField) forKey:kExtensionListIdField];	if(self.img != nil){
		[aCoder encodeObject:self.img forKey:kExtensionListImg];
	}
	[aCoder encodeObject:@(self.ishavead) forKey:kExtensionListIshavead];	[aCoder encodeObject:@(self.jumptype) forKey:kExtensionListJumptype];	if(self.jumpurl != nil){
		[aCoder encodeObject:self.jumpurl forKey:kExtensionListJumpurl];
	}
	if(self.pvid != nil){
		[aCoder encodeObject:self.pvid forKey:kExtensionListPvid];
	}
	if(self.rdposturl != nil){
		[aCoder encodeObject:self.rdposturl forKey:kExtensionListRdposturl];
	}
	[aCoder encodeObject:@(self.seriesid) forKey:kExtensionListSeriesid];	if(self.seriesname != nil){
		[aCoder encodeObject:self.seriesname forKey:kExtensionListSeriesname];
	}
	if(self.thirdadurl != nil){
		[aCoder encodeObject:self.thirdadurl forKey:kExtensionListThirdadurl];
	}
	if(self.thurl != nil){
		[aCoder encodeObject:self.thurl forKey:kExtensionListThurl];
	}
	if(self.url != nil){
		[aCoder encodeObject:self.url forKey:kExtensionListUrl];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.areaid = [[aDecoder decodeObjectForKey:kExtensionListAreaid] integerValue];
	self.areaidCxzs = [[aDecoder decodeObjectForKey:kExtensionListAreaidCxzs] integerValue];
	self.idField = [[aDecoder decodeObjectForKey:kExtensionListIdField] integerValue];
	self.img = [aDecoder decodeObjectForKey:kExtensionListImg];
	self.ishavead = [[aDecoder decodeObjectForKey:kExtensionListIshavead] integerValue];
	self.jumptype = [[aDecoder decodeObjectForKey:kExtensionListJumptype] integerValue];
	self.jumpurl = [aDecoder decodeObjectForKey:kExtensionListJumpurl];
	self.pvid = [aDecoder decodeObjectForKey:kExtensionListPvid];
	self.rdposturl = [aDecoder decodeObjectForKey:kExtensionListRdposturl];
	self.seriesid = [[aDecoder decodeObjectForKey:kExtensionListSeriesid] integerValue];
	self.seriesname = [aDecoder decodeObjectForKey:kExtensionListSeriesname];
	self.thirdadurl = [aDecoder decodeObjectForKey:kExtensionListThirdadurl];
	self.thurl = [aDecoder decodeObjectForKey:kExtensionListThurl];
	self.url = [aDecoder decodeObjectForKey:kExtensionListUrl];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	ExtensionList *copy = [ExtensionList new];

	copy.areaid = self.areaid;
	copy.areaidCxzs = self.areaidCxzs;
	copy.idField = self.idField;
	copy.img = [self.img copyWithZone:zone];
	copy.ishavead = self.ishavead;
	copy.jumptype = self.jumptype;
	copy.jumpurl = [self.jumpurl copyWithZone:zone];
	copy.pvid = [self.pvid copyWithZone:zone];
	copy.rdposturl = [self.rdposturl copyWithZone:zone];
	copy.seriesid = self.seriesid;
	copy.seriesname = [self.seriesname copyWithZone:zone];
	copy.thirdadurl = [self.thirdadurl copyWithZone:zone];
	copy.thurl = [self.thurl copyWithZone:zone];
	copy.url = [self.url copyWithZone:zone];

	return copy;
}
@end